file = open('test.txt', 'a')
file.write('hello') # write(str):把字符串写入文件，单行写入。

lst = ['java', 'go', 'python']
file.writelines(lst) # writelines(str): 把字符串按行写入文件，多行写入.
file.flush() # 立刻将缓冲区的数据存入磁盘
file.close()

# 拷贝文件
with open('copylogo.png', 'rb') as src_file:
    with open('copy2logo.png', 'wb') as target_file:
        target_file.write(src_file.read())